package com.example.shuiyin.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName("tasks")
public class Task {
    @TableId(type = IdType.AUTO)
    private Long id;
    
    @TableField("task_id")
    private String taskId;            // 任务ID
    
    @TableField("user_id")
    private Long userId;
    
    private String type;              // 任务类型
    private String status;            // 状态(pending, processing, completed, failed)
    
    @TableField("total_items")
    private Integer totalItems;       // 总项目数
    
    @TableField("processed_items")
    private Integer processedItems;   // 已处理项目数
    
    @TableField("success_items")
    private Integer successItems;     // 成功项目数
    
    @TableField("failed_items")
    private Integer failedItems;      // 失败项目数
    
    private String parameters;        // 任务参数(JSON格式)
    
    @TableField("result_url")
    private String resultUrl;         // 结果URL
    
    @TableField("error_message")
    private String errorMessage;      // 错误信息
    
    @TableField("start_time")
    private LocalDateTime startTime;  // 开始时间
    
    @TableField("end_time")
    private LocalDateTime endTime;    // 结束时间
    
    @TableField("created_at")
    private LocalDateTime createdAt;
    
    @TableField("updated_at")
    private LocalDateTime updatedAt;
} 